<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<title>服务种类人员列表</title>
		<link rel="stylesheet" type="text/css" href="../css/detial.css"/>
		<link href="../css/css.css" rel="stylesheet" type="text/css">

	</head>
	<body>
		<div class="header">礼品详情<span id="navName"></span>
			<div class="header_left" onclick="window.history.go(-1)"><img src="../images/return.png"></div>
		</div>
		<div class="main" id="splist">

		</div>
		<!--按钮-->

	</body>
	<script src="../js/jquery-1.7.1.min.js"></script>
	<script src='../js/layer/2.1/layer.js'></script>
	<script type="text/javascript" src="../script/config.js"></script>
	<script type="text/javascript">
		//获取页面间传值
		function GetRequest(str) {
			var theRequest = new Object();
			if (str.indexOf("?") != -1) {
				var strs = str.substr(1);
				strs = str.split("?")[1].split("&");
				for(var i = 0; i < strs.length; i ++) {
					theRequest[strs[i].split("=")[0]]=(strs[i].split("=")[1]);
				}
			}
			return theRequest;
		}

		var softname = location.search;
		//console.log(softname);
		var uid = GetRequest(softname).id;
	//	console.log(uid);
		uid=parseInt(uid);
		console.log(uid);
		var datas = {
			id:uid
		};
		console.log(JSON.stringify(datas));
		var vid=null;
		$.ajax({
			type: 'POST',
			url: urls+'/prize/frontFindById',
			data:JSON.stringify(datas),
			contentType: "application/json",
			success: function(req){
				console.log(req);
				var paths="";
				(req.name==""||req.name==null)? req.name="没有标题":req.name;
				(req.medalCount=="")? req.name="0":req.medalCount;
				(req.startTime==""|| req.startTime==null)? req.startTime="0000-00-00":req.startTime.substr(0,10);
				(req.endTime=="" ||req.endTime==null)? req.endTime="0000-00-00":req.endTime.substr(0,10);
				paths=urls+req.prizeImgurl;
		
				(req.prizeImgurl=="" || req.prizeImgurl==null)? paths="../upload/present.jpg":paths;

				var strs="";
				strs=strs+'<div class="list">'+
						'<div class="touxiang"><img src="'+paths+'"></div>'+
						'<div class="jianjie">'+
						'<p>名称：<span style="color: green">'+req.name+'</span></p>'+
						'<p style="margin-top: 2vh;">兑换所需奖章：<span class="userAds" style="color: red;">'+req.medalCount+'</span>&nbsp;枚</p>'+
						'<p style="margin-top: 2vh;">原价：<span style="color: red;">'+req.price+'</span>&nbsp;元</p>'+
						'<p style="margin-top: 2vh;font-size: 10px;"><span>Time:</span><span class="userAds2">'+req.startTime.substr(0,10)+'->'+req.endTime.substr(0,10)+'</span>'+
						'</p>'+
						'<p style="margin-top: 2vh;font-size: 10px;"><span >礼品详细说明：</span></p>'+
						'<div style="margin-top: 2vh;color: #666">'+req.prizeContent+''+
						'</div>'+
						'</div>'+
						'</div>';

					$("#splist").append(strs);
			},
			error:function(){
				layer.msg("请求失败");
			}

		});


	</script>
</html>
